<?php
require_once 'Usuario.php';
?>
<?php
    if (!empty($_POST["nick"]) && !empty($_POST["pass"])) {
        $us = new Usuario();
        if (!$us->exist($_POST["nick"])) {
            $us->Insertar($_POST["nick"], $_POST["pass"], $_POST["fono"], $_POST["mail"]);
            redirige("index.php");
        }
        else
            echo "Usuario ya existe..";
    }
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GestionDVD - Home</title>
<link rel="shortcut icon" href="images/icono.ico" />
<link type="text/css" rel="stylesheet" href="css/calendar.css" media="screen"/>
<link type="text/css" rel="stylesheet" href="css/estilo.css" />
<script type="text/javascript" src="scripts/calendar.js"></script>
<script type="text/javascript" src="scripts/scripts.js"></script>
<script type="text/javascript" src="scripts/ultimo.js"></script> 
</head>

<body>
<div id="mainContainer">
<?php require("conf/menu.html"); ?>

    <form method="post"id="form1" name="form1">
<table width="200" border="2" align="center" class="primary">
  <tr>
    <td colspan="2" align="center">Registro</td>
    </tr>
  <tr>
    <td>Nick</td>
    <td><input type="text" name="nick" id="nick" /></td>
    </tr>
  <tr>
    <td>Pass</td>
    <td><input type="password" name="pass" id="pass" /></td>
  </tr>
  <tr>
    <td>Fono</td>
    <td><input type="tel" name="fono" id="fono" /></td>
  </tr>
  <tr>
    <td>Mail</td>
    <td><input type="email" name="mail" id="mail" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="Enviar" /></td>
  </tr>
</table>
</form>
</div>
</body>
</html>